from django.urls import path
from .views import post_list, post_detail, post_new
urlpatterns = [
    path('', post_list, name='post_list'),
    path('post/<int:pk>/', post_detail, name='post_detail'),
    path('post/new/', post_new, name='post_new'),
]

from .views import post_edit, PostDelete  # 确保导入
urlpatterns = [
    path('', post_list, name='post_list'),
    path('post/<int:pk>/', post_detail, name='post_detail'),
    path('post/new/', post_new, name='post_new'),
    path('post/edit/<int:pk>/', post_edit, name='post_edit'),
    path('post/delete/<int:pk>/', PostDelete.as_view(), name='post_delete'),  # 删除文章的路由
]